nav_a.onmouseover = function(){nav_a_img.src='images/shocangjia_.png';}
nav_a.onmouseout = function(){nav_a_img.src='images/shocangjia.png';}
sj_2wmX.onclick=function(){sj_2wm.style.display='none'}
// 控高
var complex_top_1_h=complex_top_1.offsetHeight;
var complex_top_1_hide_style= document.querySelectorAll('#complex_top_1_hide_');
for(var complex_top_1_hide_style_ = 0;complex_top_1_hide_style_<complex_top_1_hide_style.length;complex_top_1_hide_style_++){
	complex_top_1_hide_style[complex_top_1_hide_style_].style.height = complex_top_1_h+'px';
}
var fashion_1= document.querySelectorAll('.fashion .fashion_2 .fashion_2_>.left_1');
var fashion_2= document.querySelectorAll('.fashion .fashion_2 .fashion_2_>.left_2');
for(var good_f = 0;good_f<fashion_2.length;good_f++){
	fashion_2[good_f].style.height = fashion_1[good_f].offsetHeight+'px';
}

var good_1h= document.querySelectorAll('.good li');
var good_2h= document.querySelectorAll('.good_H li');
for(var good_f = 0;good_f<good_2h.length;good_f++){
	good_2h[good_f].style.height = good_1h[1].offsetHeight+'px';
}
complex_top_2.style.height = complex_top_1_h+'px';
banner2_h.style.height = wheel_planting_2_h.offsetHeight+'px';
banner2_h.style.width = banner1_h.offsetWidth+'px';

// 轮播
var mySwiper_1 = new Swiper('.swiper-container_1', {
      slidesPerView: 1,
      spaceBetween: 30,
      loop: true,
      pagination: {
        el: '.swiper-pagination',
        clickable: true,
      },
      navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
      },
      autoplay: {
	    delay: 5000,
	    stopOnLastSlide: false,
	    disableOnInteraction: true,
	  },
});
var mySwiper_2 = new Swiper('.swiper-container_2', {
      slidesPerView: 1,
      spaceBetween: 30,
      loop: true,
      pagination: {
        el: '.swiper-pagination',
        clickable: true,
      },
      navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
      },
      autoplay: {
	    delay: 5000,
	    stopOnLastSlide: false,
	    disableOnInteraction: true,
	  },
});
var mySwiper_3 = new Swiper('.swiper-container_3', {
      direction: 'vertical',
      autoplay: {
	    delay: 5000,
	    stopOnLastSlide: false,
	    disableOnInteraction: true,
	  },
	  loop : true,
    });
mySwiper_1.el.onmouseover = function(){
     mySwiper_1.autoplay.stop();
   }
mySwiper_1.el.onmouseleave = function(){
     mySwiper_1.autoplay.start();
}
mySwiper_2.el.onmouseover = function(){
     mySwiper_2.autoplay.stop();
   }
mySwiper_2.el.onmouseleave = function(){
     mySwiper_2.autoplay.start();
}
mySwiper_3.el.onmouseover = function(){
     mySwiper_3.autoplay.stop();
   }
mySwiper_3.el.onmouseleave = function(){
     mySwiper_3.autoplay.start();
}
// 查找红色分页器的位置
var wheelPlanting_f=function(){
	var wheelPlanting = document.querySelectorAll('.wheel_planting_2 .swiper-pagination span');
	for(var wheelPlanting_ = 0;wheelPlanting_< wheelPlanting.length;wheelPlanting_++){
		if (wheelPlanting[wheelPlanting_].classList.length===2) {
			wheelPlanting_bringIn.innerHTML=wheelPlanting_+1;
		}
	}
}
// 每毫秒都查找
function wheelPlanting_lookup(){
	setTimeout(function() {
		    wheelPlanting_lookup();
		    wheelPlanting_f();
	}, 1);
}
wheelPlanting_lookup();




// 公告选项卡
var notice = document.querySelectorAll('.notice .nav > li');
var notice_ = document.querySelectorAll(".notice .main > div");
for(var i = 0;i<notice.length;i++){
	notice[i].index = i;
	notice[i].onmouseover = function(){
		// setTimeout(function() {}, 1000);
		for(var k = 0;k<notice.length;k++){
			notice[k].classList.remove('active');
			notice_[k].classList.remove('active');
		}
		this.classList.add('active');
		notice_[this.index].classList.add('active');
	}
}
// APP显隐
var app_a = document.querySelectorAll('.app li a');
var app_hide = document.querySelectorAll('.app li .app_hide');
for(var app_=0;app_<app_a.length;app_++){
	app_a[app_].index = app_;
	app_a[app_].onmouseover=function(){
		app_hide[this.index].style.display='block';
	}
	app_a[app_].onmouseout=function(){
		app_hide[this.index].style.display='none';
	}
}


// 倒计时
	window.onload=count_down;
    function count_down(){
    var today=new Date(),//当前时间
        h=today.getHours(),
        m=today.getMinutes(),
        s=today.getSeconds();
      var stopTime=new Date("Feb 9 2020 00:00:00"),//结束时间
        stopH=stopTime.getHours(),
        stopM=stopTime.getMinutes(),
        stopS=stopTime.getSeconds();
      var shenyu=stopTime.getTime()-today.getTime(),//倒计时毫秒数
        shengyuD=parseInt(shenyu/(60*60*24*1000)),//转换为天
        D=parseInt(shenyu)-parseInt(shengyuD*60*60*24*1000),//除去天的毫秒数
        shengyuH=parseInt(D/(60*60*1000)),//除去天的毫秒数转换成小时
        H=D-shengyuH*60*60*1000,//除去天、小时的毫秒数
        shengyuM=parseInt(H/(60*1000)),//除去天的毫秒数转换成分钟
        M=H-shengyuM*60*1000;//除去天、小时、分的毫秒数
        S=parseInt((shenyu-shengyuD*60*60*24*1000-shengyuH*60*60*1000-shengyuM*60*1000)/1000)//除去天、小时、分的毫秒数转化为秒

        // 输出
        // document.getElementById("div").innerHTML=(shengyuD+"天"+shengyuH+"小时"+shengyuM+"分"+S+"秒"+"<br>");
        document.querySelector(".hour").innerHTML = shengyuH;
        document.querySelector(".minute").innerHTML = shengyuM;
        if (S<10) {
        	document.querySelector(".second").innerHTML = '0'+S;
        }else{
        	document.querySelector(".second").innerHTML = S;
        }
        
        // 每隔500毫秒执行一次
        setTimeout(count_down,500);
    }
    count_down();


// 进度条数据
var progress_bar_in_total = ['260','100','105'];
var progress_bar_sell_out = ['134','4','62'];
var progress_bar_change_1 = document.querySelectorAll('.goods_2 .txt_3 .progress_bar_');
var progress_bar_change_2 = document.querySelectorAll('.goods_2 .txt_3 .percentage');
var progress_bar_change_3 = document.querySelectorAll('.goods_2 .txt_3 .sell_out');



for(var progress = 0;progress<progress_bar_sell_out.length;progress++){
	progress_bar_change_1[progress].style.width= progress_bar_sell_out[progress]/progress_bar_in_total[progress]*100+'%';
	progress_bar_change_2[progress].innerHTML = Math.round(progress_bar_sell_out[progress]/progress_bar_in_total[progress]*100)+'%';
	progress_bar_change_3[progress].innerHTML = '已抢'+progress_bar_sell_out[progress]+'件'
}
// 右边的楼层
// document.documentElement.scrollTop

var floor = document.querySelectorAll(".floor .span");
var floor_value = ['800','1820','2680','3525','4765','10000'];


window.onscroll=function(){
  if (document.documentElement.scrollTop>330) {
    document.querySelector(".right_floor").style.position='fixed';
    document.querySelector(".right_floor").style.top='75px';
    document.querySelector('.top_ss').style.display='block';
  }else{
    document.querySelector(".right_floor").style.position='absolute';
    document.querySelector(".right_floor").style.top='357px';
    document.querySelector('.top_ss').style.display='none';
  }
  for(var f = 0; f<floor_value.length;f++){
    if (document.documentElement.scrollTop>=floor_value[f]&&document.documentElement.scrollTop<floor_value[f+1]) {
      for(var f_=0;f_<floor_value.length;f_++){
        floor[f_].id='';
      }
      floor[f].id='being';
    }
    floor[f].index=f;
    floor[f].onclick =function(){
      document.documentElement.scrollTop=floor_value[this.index];
      if (this.index==5) {
         // document.documentElement.scrollTop=0;
         function top_(n){
            setTimeout(function() {
              if(n>=-100){
                window.scrollTo({
                  top:n,
                  behavior:'smooth'
                })
                  top_(n-100);
              }
            }, 1);
         }
         top_(document.documentElement.scrollTop)
      }
    }
  }
  if (document.body.clientWidth<1190){
    if (document.documentElement.scrollTop>330){
      document.querySelector('.right_floor .floor .a6').style.display='inline-block';
    }else{
      document.querySelector('.right_floor .floor .a6').style.display='none';
    }
  }
}
if (document.body.clientWidth<1190) {
  complex_top_2.style.height = "100%";
  console.log("响应啊")
  for(var good_f = 0;good_f<good_2h.length;good_f++){
    good_2h[good_f].style.height = "100%";
  }
  document.querySelector('.top_ss').style.display='block';
}
